feat: added qrtr_lookup_validation test#273
feat: added qrtr_lookup_validation test#273jeevanandan-sandan wants to merge 1 commit intoqualcomm-linux:mainfrom
Conversation
This script verifies the existence of Qualcomm IPC Router (QRTR) services on a QLI Target Signed-off-by: Jeevanandan Sandan <sandanka@qti.qualcomm.com>
| steps: | ||
| - REPO_PATH=$PWD | ||
| - cd Runner/suites/Kernel/Baseport/IPC/qrtr_lookup_validation | ||
| - ./run.sh -t adsp || true |
There was a problem hiding this comment.
Is there a reason we can't include these in the params section?
| @@ -0,0 +1,83 @@ | |||
| # qrtr-lookup Validation Test | |||
There was a problem hiding this comment.
README.md permissions should be 100644.
| - REPO_PATH=$PWD | ||
| - cd Runner/suites/Kernel/Baseport/IPC/qrtr_lookup_validation | ||
| - ./run.sh -t adsp || true | ||
| - $REPO_PATH/Runner/utils/send-to-lava.sh qrtr_lookup_validation.res || true |
| . "$TOOLS/functestlib.sh" | ||
|
|
||
| TESTNAME="qrtr_lookup_validation" | ||
| export RESULT_FILE="${PWD}/${TESTNAME}.res" |
There was a problem hiding this comment.
repo standard is
test_path=$(find_test_case_by_name "$TESTNAME")
cd "$test_path" || exit 1
res_file="./$TESTNAME.res"
| fi | ||
|
|
||
| # Only source if not already loaded | ||
| if [ -z "$__INIT_ENV_LOADED" ]; then |
There was a problem hiding this comment.
It should be
if [ -z "${__INIT_ENV_LOADED:-}" ]; then
. "$INIT_ENV"
__INIT_ENV_LOADED=1
fi
|
|
||
| # Map human-readable names to IDs | ||
| get_qrtr_id_from_name() { | ||
| key=$(echo "$1" | tr '[:upper:]' '[:lower:]') |
There was a problem hiding this comment.
use printf '%s' "$1" instead of echo "$1" (avoid echo quirks) and also quote variables consistently.
| } | ||
|
|
||
| # Check if a specific Node ID (column 3) exists | ||
| qrtr_id_exists() { |
There was a problem hiding this comment.
Your current helper is close, but I recommend adding NR>1 to skip the header line and guard on numeric fields.
| # Check if a specific Node ID (column 3) exists | ||
| qrtr_id_exists() { | ||
| target="$1" | ||
| if ! command -v qrtr-lookup >/dev/null 2>&1; then |
There was a problem hiding this comment.
remove command checks, it should handle through run.sh with check_dependencies
| if ! command -v qrtr-lookup >/dev/null 2>&1; then | ||
| return 1 | ||
| fi | ||
| qrtr-lookup | awk -v target="$target" '$3 == target { found=1; exit } END { if(!found) exit 1 }' |
There was a problem hiding this comment.
So finally it should become
qrtr_id_exists() {
target="$1"
qrtr-lookup 2>/dev/null | awk -v target="$target" '
NR>1 &&
END { exit(found ? 0 : 1) }
'
}
| # Map human-readable names to IDs | ||
| get_qrtr_id_from_name() { | ||
| key=$(echo "$1" | tr '[:upper:]' '[:lower:]') | ||
| case "$key" in |
There was a problem hiding this comment.
How about non-test services too (TFTP, SLIMbus, Thermal mitigation, etc.). So default mode should be “any service exists”, not “Test service exists”.
Better add a tiny helper qrtr_any_service_exists() then in run.sh default path use this function (pass if any service row exists)
There was a problem hiding this comment.
The purpose of this test is to verify if the qrtr_test_servers on the remote processors (like ADSP, CDSP ,GPDSP etc) are coming up during the subsystem boot up phase, which ensures that the qrtr_driver is up and working for the corresponding subsystem. And, that is why were are not checking for other services availability.
This script verifies the existence of Qualcomm IPC Router (QRTR) services on a QLI Target